﻿using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using LabNet.Server.Domain;

namespace LabNet.Server.Data
{
    public interface IEntityRepository<T> where T : BaseObject
    {
        IDataContext DataContext { get; }
        IQueryable<T> Query { get; }
        IQueryable<T> Get();
        IList<T> GetList();
        Task<IList<T>> GetAsync();
        T GetById(long id);
        T GetById(long? id);
        Task<T> GetByIdAsync(long id);
        Task<T> GetByIdAsync(long? id);
        void InsertOrUpdate(T entity);
        void Add(T entity);
        void Update(T entity);
        void Remove(T entity);
        void Detach(T entity);
        void Dispose(bool disposing);
        void Dispose();
    }
}